<!DOCTYPE HTML>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
		<meta name="format-detection" content="telephone=no,email=no,date=no,aItemress=no">
		<title>举报</title>
		<link rel="stylesheet" type="text/css" href="../../css/aui.css" />
		<link rel="stylesheet" type="text/css" href="../../css/app.css" />
		<style type="text/css">
			body {
				background-color: #f5f5f5;
			}

			.aui-title {
				font-size:.9rem;
				font-family:PingFangSC-Regular;
				font-weight:400;
				color:rgba(34,34,34,1);
			}

			.aui-pull-right {
				font-size: 0.75rem;
				color: #690078 !important;
				font-weight: bolder;
			}

			.aui-col-xs-6 {
				padding-bottom: 1.25rem;
			}

			.aui-col-xs-6:nth-child(2n+0) {
				padding-left: 1.5rem;
			}

			.aui-col-xs-6 img {
				display: inline-block;
				width: 1rem;
				vertical-align: sub;
			}

			.aui-col-xs-6 span {
				color: #CB29E2;
				font-size: 0.75rem;
			}
			.send {
				display:inline-block;
				width:17.25rem;
				height:2rem;
				line-height:2rem;
				text-align:center;
				color:#fff;
				position: absolute;
				left: 50%;
				transform:translate(-50%,2rem);
				border-radius:1.25rem;
				background:url('../../image/bg/jubao_bc.png');
				background-position: left;
			}
			.info-name {
				display:inline-block;
				float:left;
				margin-left:.45rem;
				font-size:.75rem;
				font-family:PingFangSC-Regular;
				font-weight:400;color:rgba(34,34,34,1);
			}
		</style>
	</head>

	<body>
		<div id="aui-header" class="ming-bg-blue">
			<header class="aui-bar aui-bar-nav ming-bg-blue aui-border-b">
				<a class="aui-pull-left" tapmode onclick="backto()" style="margin-left:.75rem;padding:0rem;">
					<img class="btn-img-back" src="../../image/btn/btn-back.png" />
				</a>
				<div class="aui-title">
					<div class="aui-text-linear">
						举报
					</div>
				</div>
			</header>
		</div>
		<div id="app" class="aui-content" style="padding: .75rem;background-color:#fff;">
			<div class="aui-row">
				<div class="aui-col-xs-12" style="margin-bottom:.5rem;font-size:.75rem;font-family:PingFangSC-Regular;font-weight:400;color:rgba(102,102,102,1);">
					请选择举报原因
				</div>
				<div v-for="vo in info" class="aui-col-xs-12" tapmode @click="sel_item(vo.name)">
					<div class="" style="display:inline-block;margin-top:.45rem;">
						<span style="display:inline-block;width:.95rem;float:left;">
							<img v-if="!sel_info.inArray(vo.name)" src="../../image/icon/icon-noselect.png"/>
							<img v-else src="../../image/icon/select_new.png"/>
						</span>
						<span class="info-name">{{vo.name}}</span>
					</div>
				</div>
			</div>
		</div>
		<div class="" style="display:flex;width:100%;position:relative;">
			<div tapmode onclick="tip()" class="send">
				发送
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript" src="../../script/vue.js"></script>
	<script type="text/javascript" src="../../script/common.js"></script>
	<script>
		var vm = new Vue({
			el: "#app",
			data: {
				info: [],
				sel_info: [],
				type:1
			},
			methods: {
				get_list: function() {
					get_data('api/Tip/tipType', {}, function(ret) {
						if(ret.status) {
							vm.info = ret.data
						}
					})
				},
				sel_item: function(el) {
					if(vm.sel_info.inArray(el)) {
						vm.sel_info.remove(el)
					} else {
						vm.sel_info.push(el)
					}
				},
			}
		})
		apiready = function() {
			$api.fixStatusBar($api.byId('aui-header'))
			vm.id = $api.getStorage('id')
			vm.type = api.pageParam.type
			vm.get_list()
			add_event('keyback', function(ret) {
				toast('取消举报');
				close_win()
			})
		};

		function tip() {
			get_data('api/Tip/tip', {
				token: $api.getStorage('token'),
				id: vm.id,
				tip_name: vm.sel_info.join('|'),
				type:vm.type
			}, function (ret) {
					if (ret.status == 1) {
						open_win('tip','tip.html',false);
					} else {
						toast(ret.msg)
					}
			})
			// }, function(ret) {
			// 	toast('举报成功')
			// 	delay_close()
			// })
		}

		function backto() {
			toast('取消举报');
			close_win()
		}
	</script>

</html>
